# Maintainer: psykose <alice@ayaya.dev>
pkgname=cargo-license
pkgver=0.4.2
pkgrel=0
pkgdesc="Cargo subcommand to see license of dependencies"
url="https://github.com/onur/cargo-license"
arch="all !s390x !riscv64" # rust
license="MIT"
makedepends="cargo"
source="https://github.com/onur/cargo-license/archive/refs/tags/v$pkgver/cargo-license-v$pkgver.tar.gz
	lock.patch
	"

export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_PANIC="abort"
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/cargo-license -t "$pkgdir"/usr/bin
}

sha512sums="
e4440338dbaa9ff341eda3dd1ebe29ef162b7fea7d5f7d987de2aa56916fcf0ba5a943212b7291ef6c0ffeeb069d23b26ead1e1609fadf061d784982e1c821ce  cargo-license-v0.4.2.tar.gz
d338d6f1f760859c3581d3191372aab74bd70ea5cec6fde1fb9ace68eb7710d2dc47fe500f81b784fe9d00dd4854bd93e52f807b4964b45691ed6f9be86fd3f2  lock.patch
"
